package com.cgmnx.admin.dao.mapper.rbac;

import com.cgmnx.admin.common.bean.Limiter;
import com.cgmnx.admin.dao.entity.rbac.RoleEntity;
import com.cgmnx.admin.dao.entity.rbac.RoleUserRelationEntity;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author created on 14-3-6 下午2:34
 * @version $Id$
 */@Repository
public interface RoleUserRelationMapper {

    int save(RoleUserRelationEntity entity);

    int saveAll(@Param("entityList") List<RoleUserRelationEntity> entityList);

    int update(RoleUserRelationEntity entity);

    int deleteByUserId(@Param("userIdList") List<String> userIdList);

    List<RoleUserRelationEntity> queryByUserIdList(@Param("userIdList") List<String> userIdList);

    List<RoleUserRelationEntity> queryByRoleId(@Param("id") Integer id);

    Integer count(@Param("id") Integer id);

    List<RoleEntity> queryPage(@Param("id") Integer id, @Param("limiter") Limiter limiter);

    void deleteByUserIdListAndRoleId(@Param("id") Integer roleId, @Param("userIdList") List<String> userIds);
}
